#!/bin/sh
#
# $OpenBSD: puppet_dashboard.rc,v 1.5 2016/07/02 10:50:34 sthen Exp $

daemon="./script/server -d"
daemon_flags="-e production"
daemon_user="_puppet-dashboard"

. /etc/rc.d/rc.subr

pexp="${RUBY} ${daemon}${daemon_flags:+ ${daemon_flags}}"
rc_reload=NO

rc_start() {
	${rcexec} "cd ${INSTDIR} && ${daemon} ${daemon_flags}"
}

rc_stop() {
	pkill -INT -xf "${pexp}"
}

rc_cmd $1
